<template>
	<view>
		<view @click="qian" style="width: 146rpx;height: 54rpx;line-height: 54rpx;background-color: rgba(0,0,0,.5);text-align: center;color: #F5F5F5;font-size: 24rpx;border-radius: 27rpx 0 0 27rpx;position: fixed;top:140rpx;right: 0;z-index: 4;">
			退出登录
		</view>
		<view @click="jilu" style="width: 146rpx;height: 54rpx;line-height: 54rpx;background-color: rgba(0,0,0,.5);text-align: center;color: #F5F5F5;font-size: 24rpx;border-radius: 27rpx 0 0 27rpx;position: fixed;top: 220rpx;right: 0;z-index: 4;">
			我的企业
		</view>
		<view style="position: relative;">
			<image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230419/891ea9a78def8bca8c075ac8bd5ee9c1.jpg" style="width: 750rpx;height: 300rpx;" mode=""></image>
			<image :src="tu" style="width:120rpx;height: 120rpx;display: block;border-radius: 50%;position: absolute;top: 30rpx;left: 50%;transform: translateX(-50%);"	mode=""></image>
			<view style="width: 100%;text-align: center;position: absolute;top: 170rpx;left:0;font-size: 26rpx;color: #FFFFFF;">
				{{shop_xx.name}}
				<text v-if="shop_xx.type==1">【生产企业】</text>
				<text v-if="shop_xx.type==2">【经销商】</text>
				<text v-if="shop_xx.type==3">【辅料/设备企业】</text>
			</view>
			<!-- <view style="width: 100%;text-align: center;position: absolute;top: 220rpx;left:0;font-size: 26rpx;color: #FFFFFF;">
				到期时间:{{shop_xx.expire_time}}
			</view> -->

		</view>
		<view class="" style="width: 94%;margin: 20rpx auto;">
			<!-- <view style="width: 100%;background-color: #FFFFFF;border-radius: 10rpx;display: flex;text-align: center;padding: 20rpx 0;">
				<view style="flex: 1;">
					<view>
						<text style="color: #F0AD4E;font-size: 40rpx;">16<text style="font-size: 24rpx;">个</text></text>
					</view>
					<view style="color: #000000;font-size: 26rpx;">
						代理申请量
					</view>
				</view>
				<view style="flex: 1;">
					<view>
						<text style="color: #4CD964;font-size: 40rpx;">{{shop_xx.pv}}<text style="font-size: 24rpx;">次</text></text>
					</view>
					<view style="color: #000000;font-size: 26rpx;">
						访问量
					</view>
				</view>
			</view> -->


			<!-- <view style="width: 100%;margin: 20rpx auto;background-color: #ffffff;padding:10rpx 30rpx 30rpx;box-sizing: border-box;border-radius: 14rpx;">
				<view style="line-height: 100rpx;">
					<text style="color: #000000;font-size: 30rpx;">订单管理</text>
				</view>
				<view style="text-align: center;margin-top: 10rpx;overflow: hidden;">
					<view @click="bun1(1)" style="width: 25%;float: left;">
						<image src="https://qiniuoss.yjqwl.cn/uploads/20211020/FhFxGxmtOLhZUaQjYXCiCK8dIKKe.png"
							style="width: 60rpx;height: 60rpx;" mode=""></image>
						<view style="color: #000000;font-size: 24rpx;margin-top: 10rpx;">样品申领</view>
					</view>
					<view @click="bun2(2)" style="width: 25%;float: left;">
						<image src="https://qiniuoss.yjqwl.cn/uploads/20211020/FuwJt1yQwM5iIXMxtQGkW0Bkg-4A.png"
							style="width: 60rpx;height: 60rpx;" mode=""></image>
						<view style="color: #000000;font-size: 24rpx;margin-top: 10rpx;">订货需求</view>
					</view>
					<view @click="bun(0)" style="width: 25%;float: left;">
						<image src="https://qiniuoss.yjqwl.cn/uploads/20211020/FpLAluuyoxpBg4PxoiVghzEwFnll.png"
							style="width: 60rpx;height: 60rpx;" mode=""></image>
						<view style="color: #000000;font-size: 24rpx;margin-top: 10rpx;">代理申请</view>
					</view>
				</view>

			</view>
			 -->
			<!-- <view style="width: 100%;margin: 20rpx auto;background-color: #ffffff;padding:10rpx 30rpx 30rpx;box-sizing: border-box;border-radius: 14rpx;">
				<view style="line-height: 100rpx;">
					<text style="color: #000000;font-size: 30rpx;">产品管理</text>
				</view>
				<view style="text-align: center;margin-top: 10rpx;overflow: hidden;">
					<view @click="bun(1)" style="width: 25%;float: left;">
						<image src="https://qiniuoss.yjqwl.cn/uploads/20210924/FkgDegprZ2sSoQaO71svurS_s-0n.png"
							style="width: 60rpx;height: 60rpx;" mode=""></image>
						<view style="color: #000000;font-size: 24rpx;margin-top: 10rpx;">发布产品</view>
					</view>
					<view @click="wode" style="width: 25%;float: left;">
						<image src="https://qiniuoss.yjqwl.cn/uploads/20210924/FkQEzR9_5dCMu-dZbp1Av1bBU_wm.png"
							style="width: 60rpx;height: 60rpx;" mode=""></image>
						<view style="color: #000000;font-size: 24rpx;margin-top: 10rpx;">我的产品</view>
					</view>

				</view>
			</view> -->

			<view style="width: 100%;margin: 20rpx auto;background-color: #ffffff;padding:10rpx 30rpx 30rpx;box-sizing: border-box;border-radius: 14rpx;">
				<view style="line-height: 100rpx;">
					<text style="color: #000000;font-size: 30rpx;">企业设置</text>
				</view>
				<view style="text-align: center;margin-top: 10rpx;overflow: hidden;">
					<view @click="liebiao" style="width: 25%;float: left;">
						<image src="https://qiniuoss.yjqwl.cn/uploads/20211020/FmaPqdk8CVBOe9qOkhXkddcZ6Fmk.png"
							style="width: 60rpx;height: 60rpx;" mode=""></image>
						<view style="color: #000000;font-size: 24rpx;margin-top: 10rpx;">员工列表</view>
					</view>
					<view @click="xiugai" style="width: 25%;float: left;">
						<image src="https://qiniuoss.yjqwl.cn/uploads/20211020/FrRHQXNJzGqZR226ngXpxIFH1o5V.png"
							style="width: 60rpx;height: 60rpx;" mode=""></image>
						<view style="color: #000000;font-size: 24rpx;margin-top: 10rpx;">补充修改资料</view>
					</view>

					<view @click="huifu(1)" style="width: 25%;float: left;">
						<image src="https://qiniuoss.yjqwl.cn/uploads/20211020/FmaPqdk8CVBOe9qOkhXkddcZ6Fmk.png"
							style="width: 60rpx;height: 60rpx;" mode=""></image>
						<view style="color: #000000;font-size: 24rpx;margin-top: 10rpx;">回复留言</view>
					</view>

					<view @click="toAudit" style="width: 25%;float: left;">

						<image src="https://qiniuoss.yjqwl.cn/uploads/20211020/FrRHQXNJzGqZR226ngXpxIFH1o5V.png"
							style="width: 60rpx;height: 60rpx;" mode=""></image>
						<view style="color: #000000;font-size: 24rpx;margin-top: 10rpx;">审核</view>
					</view>
					<!-- <view @click="shen" style="width: 25%;float: left;">
						<image src="https://qiniuoss.yjqwl.cn/uploads/20211020/FmaPqdk8CVBOe9qOkhXkddcZ6Fmk.png"
							style="width: 60rpx;height: 60rpx;" mode=""></image>
						<view style="color: #000000;font-size: 24rpx;margin-top: 10rpx;">员工申请</view>
					</view> -->
				</view>
			</view>
			<view @click="tianjia" style="width: 100%;height: 80rpx;line-height: 80rpx;border-radius: 40rpx;text-align: center;font-size: 28rpx;color: #FFFFFF;background-color: #1fb0ac;margin-top: 60rpx;">
				添加员工
	 		</view>


			<view style="font-size: 30rpx;color: #333;width: 100%;margin: 100rpx auto 0;text-align: center;">
				<view style="line-height: 50rpx;">
					您的企业管理地址:<br/>{{shop_xx.login_url || ''}}
				</view>
				<view style="line-height: 50rpx;">
					企业账号:{{shop_xx.login_account || ''}}
				</view>
				<view style="line-height: 50rpx;">
					初始密码:{{shop_xx.login_password || ''}}
				</view>
			</view>


		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				tu: 'https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/7b06f625a5e04ee7f41361c5d11045b.png',
				shop_xx:{}
			}
		},
		onLoad() {
			// this.shop_xx=uni.getStorageSync('shop_xx')
			// this.tu=this.shop_xx.logo
			// this.yang()
			this.qiye()
		},
		onPullDownRefresh() {
			this.qiye()
		       setTimeout(function () {
		           uni.stopPullDownRefresh();
		       }, 1500);
		  },
		methods:{
			toAudit() {
				uni.navigateTo({
					url:'/subpages/pages/auditJoinCompany/index'
				})
			},
			// 增加访问量
			yang:function(){
				this.post('api/homepage/pageviews',{path:'/subpages/pages/shop/shopjia'},true).then(res=>{
					console.log(res)
				})
			},
			// 获取企业信息
			qiye:function(){
				this.post('api/firm/info','',true).then(res=>{
					console.log(res)
					if(res.code==1){
						this.shop_xx=res.data
						this.tu=res.data.logo_image
						uni.setStorageSync('shop_xx',res.data)
					}
				})
			},
			bun:function(type){
				uni.navigateTo({
					url:'shoporder?type='+type
				})
			},
			bun1:function(type){
				uni.navigateTo({
					url:'yangpin?type='+type
				})
			},
			bun2:function(type){
				uni.navigateTo({
					url:'dingdan?type='+type
				})
			},
			huifu:function(){
				uni.navigateTo({
					url:'wdfb'
				})
			},
			jilu:function(){
				if(this.shop_xx.special_type==2){
					uni.navigateTo({
						url:'wuliuqiye/wl_qyxq?id='+this.shop_xx.id
					})
				}else{
					uni.navigateTo({
						url:'/fenbao/pages/wenzhang/qyxq?id='+this.shop_xx.id
					})
				}

			},
			qian:function(){
				uni.switchTab({
					url:'/pages/index/wode'
				})
			},
			xiugai:function(){
				if(this.shop_xx.special_type==1){
					this.post('api/firm/info','',true).then(res=>{
						if(res.code==1){
							if(res.data.status==0){
								uni.navigateTo({
									url:'sj_xg1'
								})
							}else{
								uni.navigateTo({
									url:'sj_xg'
								})
							}
						}
					})
				}else if(this.shop_xx.special_type==2){
					this.post('api/firm/info','',true).then(res=>{
						if(res.code==1){
							if(res.data.status==0){
								uni.navigateTo({
									url:'qy_xg1'
								})
							}else{
								uni.navigateTo({
									url:'qy_xg'
								})
							}
						}
					})

				}else if(this.shop_xx.special_type==3){
					this.post('api/firm/info','',true).then(res=>{
						if(res.code==1){
							if(res.data.status==0){
								uni.navigateTo({
									url:'sj_xg3'
								})
							}else{
								uni.navigateTo({
									url:'sj_xg2'
								})
							}
						}
					})
				}
			},
			tianjia:function(){
				uni.navigateTo({
					url:'tjyg'
				})
			},
			liebiao:function(){
				uni.navigateTo({
					url:'yg_list'
				})
			},
			shen:function(){
				uni.navigateTo({
					url:'yg_sq'
				})
			}
		}

	}
</script>

<style lang="scss">
	page{
		background-color: #F5F5F5;
		font-family: Demibold;
	}
</style>
